class CreateFetionMessages < ActiveRecord::Migration
  def self.up
    create_table :fetion_messages do |t|
      t.integer :fetion_id
      t.datetime :recieved_at
      t.string :status, :default => 'unread'
      t.string :mobile
      t.string :fetion_user_id
      t.string :fetion_sid
      t.boolean :agreed
      t.string :desc
      t.text :message
      t.date :sent_on      
      t.string :before_state,
        :current_state
      t.string :client_state
      t.string :type
      t.timestamps
    end
    add_column :users, :fetion_sid, :string
    add_column :users, :fetion_user_id, :string
    add_column :users, :fetion_version, :string, :default => 'maple20'
    add_column :users, :lite_fetion_status, :string, :default => 'wait'
  end

  def self.down
    drop_table :fetion_messages
    remove_columns :users,
      :fetion_sid,
      :fetion_user_id,
      :fetion_version,
      :lite_fetion_status
  end
end
